import * as Taro from "@tarojs/taro";
class Ad {
    constructor() {
    }
    /**
     * 激励视频
     * @param adUnitId
     * @param callback
     */
    rewardedVideoAd(adUnitId, callback) {
        const ad = Taro.createRewardedVideoAd({ adUnitId });
        ad.onLoad(res => {
            console.log('onload', res);
        });
        ad.onClose((res) => {
            console.log('onClose', res);
            //  广告结束
            //  是否看完广告
            const isEnded = res.isEnded;
            callback(isEnded);
        });
        ad.load().then(() => {
            ad.show().then();
        });
    }
}
export default new Ad();
